use "$Folder/Data_Civil_Servants_final.dta", clear
keep if sample==1

foreach var of global all_DV  {
	qui reg `var' i.treatment $ControlsB if time==1 & influence_workshop_request==0, vce(cluster agency) 
	est store `var'_CB
}

#delimit ;
global Note_Table_4 "
{\begin{minipage}{1.53\textwidth}
\small  
\vspace{0.2cm} 
\textit{Notes:} * p $math < $math 0.10, ** p $math < $math 0.05, *** p $math < $math 0.01. Standard errors clustered by agency are shown in parentheses. The dependent variable in the first column is the winsorized number of business days agencies took to respond (winsorized the 5\% highest values) and it only considers closed requests by November 27, 2019. Control variables include: month in which the agency received the request, the total number of requests received by the agency before the intervention (Jan 1, 2017 until Sept. 5, 2018), average percentage of pending requests (not past the deadline - \textit{Mean of \% Pending Pre}) before the intervention, average percentage of late requests on a date prior to the intervention (\textit{Mean of \% Backlog Pre}), type of requester, serial requesters, topic of the request, total number of requests received by the agency on the date request \$ i \$ arrived, and ministry of the agency. 
 \end{minipage}
 }
";
#delimit cr




esttab business_w5_CB comply_CB complete_CB open_request_CB extension_CB business_days_within_15_CB business_days_within_25_CB business_days_15_CB business_days_25_CB using "$Tables/Table_4_a.tex", replace  label  b(%5.3f) se(%5.3f) star(* 0.10 ** 0.05 *** 0.01) mlabels("Business Days" "Replied in time" "Complete answer" "Open request" "Extension was granted" "Replied within 15 bd" "Replied within 25 bd" "Replied in 15 bd" "Replied in 25 bd") keep(1.treatment _cons) refcat(1.treatment   "\vspace{-6mm}", nolabel) stats(N r2,  labels(`"Observations"' `"R-squared"', prefix(\addlinespace[3pt])) fmt( %10.0fc %10.3fc 0 0) )  coeflabels($labels)  addnote($Note_Table_4)  nonumber nonote compress noomitted nobaselevels 

foreach var in business_w5 comply complete open_request extension business_days_within_15 business_days_within_25 business_days_15 business_days_25  {
	qui reg `var' i.treatment $ControlsB if time==1 & influence_workshop_request==1, vce(cluster agency) 
	est store `var'_CB
}

esttab business_w5_CB comply_CB complete_CB open_request_CB extension_CB business_days_within_15_CB business_days_within_25_CB business_days_15_CB business_days_25_CB using "$Tables/Table_4_b.tex", replace  label  b(%5.3f) se(%5.3f) star(* 0.10 ** 0.05 *** 0.01) mlabels("Business Days" "Replied in time" "Complete answer" "Open request" "Extension was granted" "Replied within 15 bd" "Replied within 25 bd" "Replied in 15 bd" "Replied in 25 bd") keep(1.treatment _cons) refcat(1.treatment   "\vspace{-6mm}", nolabel) stats(N r2,  labels(`"Observations"' `"R-squared"', prefix(\addlinespace[3pt])) fmt( %10.0fc %10.3fc 0 0) )  coeflabels($labels)  addnote($Note_Table_E3)  nonumber nonote compress noomitted nobaselevels 


